Skip to content

Conversation

@Igor-splunk
Copy link
Collaborator

@Igor-splunk Igor-splunk commented Oct 21, 2025

Description

Fixes AWS S3 region parsing to support 4-part regions like us-gov-west-1, us-iso-east-1, and us-isob-east-1. The previous regex only matched 3-part regions (e.g., us-west-2), causing App Framework to fail when using GovCloud or ISO endpoints.

Key Changes

  • pkg/splunk/client/awss3client.go: Updated regionRegex from ([a-z]+-[a-z]+-[0-9]+) to ([a-z]+-[a-z]+(?:-[a-z]+)?-[0-9]+) to make the third region component optional
  • pkg/splunk/client/awss3client_test.go: Added TestGetRegion() with 10 test cases covering standard (3-part), GovCloud (4-part), and ISO regions, plus error scenarios

Testing and Verification

  • Added comprehensive unit tests validating region extraction for:
    • Standard regions: us-west-2, eu-west-1
    • GovCloud regions: us-gov-west-1, us-gov-east-1
    • ISO regions: us-iso-east-1, us-isob-east-1
    • Bucket prefix variations and invalid endpoints

Related Issues

#1567

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@coveralls
Copy link
Collaborator

coveralls commented Oct 21, 2025

Pull Request Test Coverage Report for Build 18688544828

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 86.544%

Files with Coverage Reduction New Missed Lines %
pkg/splunk/enterprise/afwscheduler.go 1 92.9%
Totals Coverage Status
Change from base Build 18653942794: -0.008%
Covered Lines: 10709
Relevant Lines: 12374

💛 - Coveralls

@vivekr-splunk vivekr-splunk self-requested a review October 22, 2025 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants